<?php

namespace common\validate;

class StepCategoryMonthReport extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    // Fields 验证场景定义
    public function sceneFields()
    {
        return $this;
    }

    // Find 验证场景定义
    public function sceneFind()
    {
        return $this
            ->append("param", "require|array")
            ->append("param.filter", "require|array");
    }

    // Select 验证场景定义
    public function sceneSelect()
    {
        return $this
            ->append("param", "array")
            ->append("param.page", "array");
    }

    // Create 验证场景定义
    public function sceneCreate()
    {
        return $this->append('data.name', 'require|max:128')
            ->append('data.code', 'max:128');
    }

    // Update 验证场景定义
    public function sceneUpdate()
    {
        return $this->append('data.id', 'require')
            ->append('data.name', 'max:128')
            ->append('data.code', 'max:128');
    }

    // Delete 验证场景定义
    public function sceneDelete()
    {
        return $this->append('param.filter', 'require');
    }

    // StepCategoryList 验证场景定义
    public function sceneStepCategoryList()
    {
        return $this
            ->append('param.project_id', 'require')
            ->append('param.only_abnormal', 'in:yes,no');
    }

    public function sceneDetail()
    {
        return $this
            ->append('param.project_id', 'require')
            ->append('param.step_category_id_list', 'require');
    }

    public function sceneGetDeliveryList()
    {
        return $this
            ->append('param.filter.project_id', 'require')
            ->append('param.filter.step_category_id_list', 'require');
    }

    public function sceneGetWorkOrderProblemList()
    {
        return $this
            ->append('param.filter.project_id', 'require')
            ->append('param.filter.step_category_id_list', 'require');
    }

    public function sceneGetWorkOrderProblemCount()
    {
        return $this
            ->append('param.filter.project_id', 'require')
            ->append('param.filter.step_category_id_list', 'require');
    }
}
